<template>
  <van-nav-bar :title="props.title" left-arrow  @click-left="goBack">
    <!-- 动态赋值用v-bind绑定 -->
    <template #right>
      <van-icon name="ellipsis" size="30px"/>
    </template>
  </van-nav-bar>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router =useRouter()
const props=defineProps({  //父给子传值
  title:{
    type:String,
    default:'' //没值，默认为空
  }
})
const goBack=()=>{
  //go 跳到上一层
  router.go(-1)
}
</script>

<style lang="less" scoped>
         
</style>